<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="EditProfile.aspx.cs" Inherits="EditProfile" Title="Edit profile - gatsb" %>
<%@ Register Assembly="Decav.Gatsb.Web" Namespace="Decav.Gatsb.Web.Controls" TagPrefix="gatsb" %>
<%@ Register Src="~/PrivacySliderControl.ascx" TagName="PrivacySliderControl" TagPrefix="decavuc" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajax" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeaderPlaceholder" Runat="Server">
    <script language="javascript" type="text/javascript">
        function ToggleAlternateSmsTextBox()
        {
            var tb = document.getElementById("<%= alternateSmsTextBox.ClientID %>");
            
            if (tb.style.display == "none")
                tb.style.display = "inline";
            else
                tb.style.display = "none";
        }
        
        function AllowChangeMobile()
        {
            var myDiv = document.getElementById("changeMobileDiv");
            myDiv.style.display = "block";
            
            var myButton = document.getElementById("changeMobileButton");
            myButton.style.display = "none";
        }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="PageBodyPlaceholder" Runat="Server">
    <h1>Change Your Profile</h1>
    <div runat="server" id="serverStatusMsgDiv" visible="false" class="StatusRibbon"></div>
    <div runat="server" id="serverErrorMsgDiv" visible="false" class="ErrorRibbon"></div>
    <div style="margin-top:20px;width:500px;margin-left:200px;margin-right:200px;">
    <ajax:TabContainer ID="tabs" runat="server">
    
        <ajax:TabPanel HeaderText="General" runat="server">
        <ContentTemplate>
            <div class="StyledForm">
                <p>
                    <label for="<%= nameTextBox.ClientID %>">Name</label>
                    <asp:TextBox runat="server" ID="nameTextBox" MaxLength="120" />
                </p>        
                <p class="NewSection">
                    <label for="<%= postalCodeTextBox.ClientID %>">Home Zip Code</label>
                    <asp:TextBox runat="server" ID="postalCodeTextBox" MaxLength="5" />
                </p>
                <p>
                    <label>Gender</label>
                    <span class="ButtonGroup">
                        <asp:RadioButton runat="server" ID="maleGenderRadio" GroupName="gender" Text="Male" /><br />
                        <asp:RadioButton runat="server" ID="femaleGenderRadio" GroupName="gender" Text="Female" />
                    </span>
                </p>
                <p class="NewSection">
                    <label for="<%= aboutTextBox.ClientID %>">About</label>
                    <asp:TextBox runat="server" ID="aboutTextBox" TextMode="multiLine" MaxLength="2000"/>
                </p>
            </div>
        </ContentTemplate>
        </ajax:TabPanel>
        <ajax:TabPanel HeaderText="Privacy" runat="server">
        <ContentTemplate>
            <div class="StyledForm">
                <p>
                    <label>Profile</label>
                    <decavuc:PrivacySliderControl runat="server" ID="profileSlider" />
                </p>
                <p class="NewSection">
                    <label>Location</label>
                    <decavuc:PrivacySliderControl runat="server" ID="locationSlider" />
                </p>
                <p class="NewSection">
                    <label>Posts (Default)</label>
                    <decavuc:PrivacySliderControl runat="server" ID="postsSlider" />
                </p>
            </div>
        </ContentTemplate>
        </ajax:TabPanel>
        <ajax:TabPanel HeaderText="Picture" runat="server">
        <ContentTemplate>
            <div>
                <gatsb:UserImage Size="Medium" alt="#" runat="server" id="profileImage" />
                <span runat="server" id="noProfileImageText">
                    You have not yet added a profile picture.
                </span>
            </div>
            <div class="StyledForm">
                <p>
                    <label for="<%= pictureUploadBox.ClientID %>">New Picture</label>
                    <asp:FileUpload runat="server" ID="pictureUploadBox" />
                </p>
                <p>
                    Your picture can be in virtually any image format, and up to 2MB in size.
                </p>
            </div>
        </ContentTemplate>
        </ajax:TabPanel>
        <ajax:TabPanel HeaderText="Mobile and Telephone" runat="server">
        <ContentTemplate>
            <div class="StatusRibbon">
                Changing your mobile telephone settings will require revalidation.<br />
                <br />
                <input type="button" id="changeMobileButton" onclick="AllowChangeMobile();"
                    value="Change Settings" />
            </div>
            <div class="StyledForm">
                <div id="changeMobileDiv" style="display:none;">
                    <p class="NewSection">
                        <label for="<%= mobileTelTextBox.ClientID %>">Mobile Tel</label>
                        <asp:TextBox runat="server" ID="mobileTelTextBox" MaxLength="10" />
                    </p>
                    <p>
                        <label for="<%= mobileProviderDropdown.ClientID %>">Provider</label>
                        <gatsb:WirelessProviderDropdown runat="server" ID="mobileProviderDropdown"/>
                    </p>
                    <p>
                        <label for="<%= alternateSmsTextBox.ClientID %>">SMS Email Address</label>
                        <input type="checkbox" runat="server"
                            id="alternateSmsCheck"
                            onclick="ToggleAlternateSmsTextBox();" /> 
                        My phone has a different email account (advanced)<br />
                        <br />
                        <asp:TextBox runat="server" ID="alternateSmsTextBox" MaxLength="60" />
                    </p>
                </div>
            </div>
        </ContentTemplate>
        </ajax:TabPanel>
        <ajax:TabPanel HeaderText="Change Password" runat="server">
        <ContentTemplate>
            <div class="StyledForm">
                <p>
                    <label for="<%= oldPasswordTextBox.Text %>">Old Password</label>
                    <asp:TextBox runat="server" ID="oldPasswordTextBox" TextMode="password" />
                </p>
                <p class="NewSection">
                    <label for="<%= newPasswordTextBox.Text %>">New Password</label>
                    <asp:TextBox runat="server" ID="newPasswordTextBox" TextMode="password" />
                </p>
                <p>
                    <label for="<%= newPasswordVerifyTextBox.Text %>">Verify Password</label>
                    <asp:TextBox runat="server" ID="newPasswordVerifyTextBox" TextMode="password" />
                </p>
            </div>
        </ContentTemplate>
        </ajax:TabPanel>
    </ajax:TabContainer>
    <div style="text-align:center;margin-top:20px;">
        <asp:Button runat="server" ID="submitButton" UseSubmitBehavior="true" Text="Update" OnClick="UpdateButton_Click" />
        <asp:Button runat="server" ID="cancelButton" UseSubmitBehavior="false" Text="Cancel" OnClick="CancelButton_Click" />
    </div>
    </div>
</asp:Content>

